home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat2 / shmget.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  2.9 KB  |  67 lines

  1.  
  2. SHMGET(2)                  UNIX Programmer's Manual                  SHMGET(2)
  3.  
  4. NNAAMMEE
  5.      sshhmmggeett - get shared memory area identifier
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  10.      ##iinncclluuddee <<ssyyss//sshhmm..hh>>
  11.  
  12.      _i_n_t
  13.      sshhmmggeett(_k_e_y___t _k_e_y, _i_n_t _s_i_z_e, _i_n_t _s_h_m_f_l_g)
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      sshhmmggeett() returns the shared memory identifier associated with the key
  17.      _k_e_y.
  18.  
  19.      A shared memory segment is created if either _k_e_y is equal to IPC_PRIVATE,
  20.      or _k_e_y does not have a shared memory segment identifier associated with
  21.      it, and the IPC_CREAT bit is set in _s_h_m_f_l_g_.
  22.  
  23.      If a new shared memory segment is created, the data structure associated
  24.      with it (the _s_h_m_i_d___d_s structure, see shmctl(2))  is initialized as fol-
  25.      lows:
  26.  
  27.      ++oo   _s_h_m___p_e_r_m_._c_u_i_d and _s_h_m___p_e_r_m_._u_i_d are set to the effective uid of the
  28.          calling process.
  29.  
  30.      ++oo   _s_h_m___p_e_r_m_._g_i_d and _s_h_m___p_e_r_m_._c_g_i_d are set to the effective gid of the
  31.          calling process.
  32.  
  33.      ++oo   _s_h_m___p_e_r_m_._m_o_d_e is set to the lower 9 bits of _s_h_m_f_l_g.
  34.  
  35.      ++oo   _s_h_m___l_p_i_d, _s_h_m___n_a_t_t_c_h, _s_h_m___a_t_i_m_e, and _s_h_m___d_t_i_m_e are set to 0
  36.  
  37.      ++oo   _s_h_m___c_t_i_m_e is set to the current time.
  38.  
  39.      ++oo   _s_h_m___s_e_g_s_z is set to the value of _s_i_z_e.
  40.  
  41. RREETTUURRNN VVAALLUUEESS
  42.      Upon successful completion a positive shared memory segment identifier is
  43.      returned.  Otherwise, -1 is returned and the global variable _e_r_r_n_o is set
  44.      to indicate the error.
  45.  
  46. EERRRROORRSS
  47.      [EACESS]      A shared memory segment is already associated with _k_e_y and
  48.                    the caller has no permission to access it.
  49.  
  50.      [EEXIST]      Both IPC_CREAT and IPC_EXCL are set in _s_h_m_f_l_g, and a shared
  51.                    memory segment is already associated with _k_e_y.
  52.  
  53.      [ENOSPC]      A new shared memory indentifier could not be created be-
  54.                    cause the system limit for the number of shared memory
  55.                    identifiers has been reached.
  56.  
  57.      [ENOENT]      IPC_CREAT was not set in _s_h_m_f_l_g and no shared memory seg-
  58.                    ment associated with _k_e_y was found.
  59.  
  60.      [ENOMEM]      There is not enough memory left to created a shared memory
  61.                    segment of the requested size.
  62.  
  63. SSEEEE AALLSSOO
  64.      shmctl(2),  shmat(2),  shmdt(2)
  65.  
  66.  NetBSD                         August 17, 1995                              1
  67.